19. Exercise: JavaDoc

Exercise: JavaDoc

JavaDoc for a Class

Task Description:

JavaDoc comments are pretty straightforward, but you should be sure to try them out for yourself in IntelliJ.

First, try creating JavaDoc comments for a class:

Task List:

Task Feedback:

Nice work!

JavaDoc for a Method

Task Description:

Now let's try creating a JavaDoc comment for a method:

Task List:

Task Feedback:

Nice work!

Solution

ND079 C1 L1 A14 JAVA Solution

Here is the code shown in the video, for adding JavaDoc to both a class and a method. Remember that JavaDocs have two parts: A description and block tags.

/**
 * @author jeff.phillips
 *
 */
public class JavaDocExample {

    /**
     * 
     * @param string
     * @param number
     * @return
     */
    public String sampleMethod(String string, int number) {
        return "Result";
    }

}